# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=shadowexplorer
pkgver=0.9
pkgrel=1
groups=('blackarch' 'blackarch-forensic' 'blackarch-windows')
pkgdesc='Browse the Shadow Copies created by the Windows Vista / 7 / 8 / 10 Volume Shadow Copy Service.'
arch=('x86_64')
url='https://www.shadowexplorer.com/downloads.html'
license=('custom:unknown')
depends=('wine' 'wine_gecko' 'wine-mono')
source=('https://www.shadowexplorer.com/uploads/ShadowExplorer-0.9-portable.zip')
sha512sums=('f79db68ce8274196cc74f224e08c6ef3fb57c844b05e25627c313d73d98cd68a2281f563990bcaedc8914f1db57672be11dc5348d0f6300dbef8ea4f90fb76bb')

package() {
  cd "ShadowExplorerPortable-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/windows/$pkgname"

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/windows/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/windows/$pkgname
exec wine ShadowExplorerPortable.exe
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

